package com.cc.util;

public class StringUtil {
	public static String trim(String s){
		if(s == null) return null;
		else{
			String t = s.trim();
			if(t.length() == 0) return null;
			else return t;
		}
	}
	
	public static String getExceptionInfo(Exception e){
        StringBuffer sb = new StringBuffer();
        if(e != null){
            StackTraceElement[] stackTrace = e.getStackTrace();
            for(int i = 0,len = stackTrace.length;i<len;i++){
                sb.append(stackTrace[i].toString() + "\n");
            }
            sb.append(e.toString());
        }
        
        return sb.toString();
    }
}
